import Vue from 'vue'
import Vuex from 'vuex'
import pluginPersist from "@/utils/pluginPersist";
import userInfo from "@/store/modules/user";

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        userInfolist: {
            username: null,
            password: null,
            token: null,
        }
    },
    getters: {},
    mutations: {
        changeLogin(state) {
            state.loginState = !state.loginState
        },
        changeregisterList(state, pepole) {
            state.registerList.username = pepole.username
            state.registerList.phoneNumber = pepole.phoneNumber
            state.registerList.userId = pepole.userId
            return state.registerList
        },
    },
    actions: {},
    modules: {
        userInfo
    },
    plugins: [pluginPersist],
})
